<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
    <style>

        .time {
            background-color: aliceblue;
            text-align: center;
        }
        .box{
            width: 400px;
            height: 300px;
        }

        .left1 {
            background-color: #a2fdd0;
            font-size: bold;
            text-align: center;
        }

        .right2 {
            background-color: #ffcad3;
            height: 50px;
            text-align: center;
        }

        .box3 {
            height: 200px;
            width: 0em;
            background-color: rgb(149, 250, 250);
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="app">
        <mycom :msg="msg" @my-event="xyz"></mycom>
    </div>
    <script>
        var component1 = {
            props: ['msg'],
            data() {
                return {
                    commsg:'组件数据' 
                }
            },
            template: `
            <div>
            <div>
                <div><table class="box">
                    <tr>
                        <td class="left1"><strong>图书馆人流量</strong></td>
                        <td class="right2">
                            <span class="time">年</span>
                            <span class="time">月</span>
                            <span class="time">日</span>
                        </td>
                    </tr>
                    <tr class="box3">
                        <td colspan="3">欢迎来到四川化院图书馆</td>
                    </tr>
                    </table></div>
            </div>
        </div> 
        `,
            methods: {
                abc() {
                    this.$emit('my-event', this.commsg)
                }
            }
        }
        var vm = new Vue({
            el: '#app',
            data: {
              
            },
            methods: {

            },
            components: {
                'mycom': component1
            }
        })
    </script>
</body>

</html>